<!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伪元素</title>
    <style type="text/css">
        h3 {
            text-align: center;
        }
        
        .wrapper {
            /* --- 与 盒子模型 有关的CSS属性 ---*/
            width: 400px;
            background: #dedede;
            border: 1px solid blue;
            margin: 15px auto;
        }
        
        .child {
            width: 80%;
            height: 50px;
            background: rgba(255, 186, 96, 0.5);
        }
        
        .first::before,
        .first::after {
            display: block;
            width: 100px;
            height: 50px;
            content: '';
        }
        
        .first::before {
            background: #9696ff;
        }
        
        .first::after {
            background: #ffff00;
        }
        
        .second::before {
            content: '东华理工大学';
        }
        
        .second::after {
            content: '一统江湖';
        }
        
        .liuyifei::before {
            display: block;
            content: '段誉的神仙姐姐';
        }
        
        .input::before {
            display: block;
            content: '你好';
        }
    </style>
</head>

<body>


    <h3>在元素内部产生伪元素(被当作块元素处理)</h3>
    <div class="wrapper first">
        <div class="child">这是一个块元素</div>
    </div>

    <h3>在元素内部产生伪元素(被当作内联元素处理)</h3>
    <div class="wrapper second">
        <span class="child">风里雨里，我在东理等你</span>
    </div>

    <h3>尝试在"替换元素"中生成伪元素</h3>
    <img src="liuyifei.jpg" class="liuyifei">
    <hr>
    <img src="luoyufeng.jpg" class="liuyifei">
    <hr>
    <input type="text" class="input">

</body>

</html>